package com.atguigu.javase.bank;

public class Bank {

	private Customer[] customers;
	private int numberOfCustomer;

	public Customer[] getCustomers() {
		return customers;
	}

	public int getNumOfCustomers() {
		return numberOfCustomer;
	}

	public Bank() {
		super();
		customers = new Customer[10000];
	}

	public void addCustomer(String f, String l) {
		Customer customer = new Customer(f, l);
		if (numberOfCustomer < customers.length) {
			customers[numberOfCustomer++] = customer;
		} else {
			System.out.println("用户已满");
		}
	}

	public Customer getCustomer(int index) {
		if (index < numberOfCustomer) {
			return customers[index ];
		} else {
			return null;
		}
	}
}
